package org.x4444;

import javax.naming.InitialContext;
import javax.naming.NamingException;

public class AccountClient20 {

	private final Account account;

	public AccountClient20() throws NamingException {
		InitialContext ic = new InitialContext();
		account = (Account) ic.lookup(Account.class.getName());
	}

	public static void main(String[] args) {
		AccountClient20 ac;
		try {
			ac = new AccountClient20();
			ac.doIt();
		} catch (NamingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	void doIt() {
		try {
			String res = account.getName();

			System.out.println(res);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
